/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "parcela_pagar")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ParcelaPagar.findAll", query = "SELECT p FROM ParcelaPagar p")})
public class ParcelaPagar implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(name = "NUMERO_PARCELA")
    private Integer numeroParcela;
    @Column(name = "DATA_EMISSAO")
    @Temporal(TemporalType.DATE)
    private Date dataEmissao;
    @Column(name = "DATA_VENCIMENTO")
    @Temporal(TemporalType.DATE)
    private Date dataVencimento;
    @Column(name = "DESCONTO_ATE")
    @Temporal(TemporalType.DATE)
    private Date descontoAte;
    @Column(name = "SOFRE_RETENCAO")
    private Character sofreRetencao;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(precision = 18, scale = 6)
    private BigDecimal valor;
    @Column(name = "TAXA_JURO", precision = 18, scale = 6)
    private BigDecimal taxaJuro;
    @Column(name = "TAXA_MULTA", precision = 18, scale = 6)
    private BigDecimal taxaMulta;
    @Column(name = "TAXA_DESCONTO", precision = 18, scale = 6)
    private BigDecimal taxaDesconto;
    @Column(name = "VALOR_JURO", precision = 18, scale = 6)
    private BigDecimal valorJuro;
    @Column(name = "VALOR_MULTA", precision = 18, scale = 6)
    private BigDecimal valorMulta;
    @Column(name = "VALOR_DESCONTO", precision = 18, scale = 6)
    private BigDecimal valorDesconto;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idParcela")
    private List<ParcelaPagamento> parcelaPagamentoList;
    @JoinColumn(name = "ID_LANCAMENTO_PAGAR", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private LancamentoPagar idLancamentoPagar;
    @JoinColumn(name = "ID_STATUS_PARCELA_PAGAR", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private StatusParcela idStatusParcelaPagar;

    public ParcelaPagar() {
    }

    public ParcelaPagar(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getNumeroParcela() {
        return numeroParcela;
    }

    public void setNumeroParcela(Integer numeroParcela) {
        this.numeroParcela = numeroParcela;
    }

    public Date getDataEmissao() {
        return dataEmissao;
    }

    public void setDataEmissao(Date dataEmissao) {
        this.dataEmissao = dataEmissao;
    }

    public Date getDataVencimento() {
        return dataVencimento;
    }

    public void setDataVencimento(Date dataVencimento) {
        this.dataVencimento = dataVencimento;
    }

    public Date getDescontoAte() {
        return descontoAte;
    }

    public void setDescontoAte(Date descontoAte) {
        this.descontoAte = descontoAte;
    }

    public Character getSofreRetencao() {
        return sofreRetencao;
    }

    public void setSofreRetencao(Character sofreRetencao) {
        this.sofreRetencao = sofreRetencao;
    }

    public BigDecimal getValor() {
        return valor;
    }

    public void setValor(BigDecimal valor) {
        this.valor = valor;
    }

    public BigDecimal getTaxaJuro() {
        return taxaJuro;
    }

    public void setTaxaJuro(BigDecimal taxaJuro) {
        this.taxaJuro = taxaJuro;
    }

    public BigDecimal getTaxaMulta() {
        return taxaMulta;
    }

    public void setTaxaMulta(BigDecimal taxaMulta) {
        this.taxaMulta = taxaMulta;
    }

    public BigDecimal getTaxaDesconto() {
        return taxaDesconto;
    }

    public void setTaxaDesconto(BigDecimal taxaDesconto) {
        this.taxaDesconto = taxaDesconto;
    }

    public BigDecimal getValorJuro() {
        return valorJuro;
    }

    public void setValorJuro(BigDecimal valorJuro) {
        this.valorJuro = valorJuro;
    }

    public BigDecimal getValorMulta() {
        return valorMulta;
    }

    public void setValorMulta(BigDecimal valorMulta) {
        this.valorMulta = valorMulta;
    }

    public BigDecimal getValorDesconto() {
        return valorDesconto;
    }

    public void setValorDesconto(BigDecimal valorDesconto) {
        this.valorDesconto = valorDesconto;
    }

    @XmlTransient
    public List<ParcelaPagamento> getParcelaPagamentoList() {
        return parcelaPagamentoList;
    }

    public void setParcelaPagamentoList(List<ParcelaPagamento> parcelaPagamentoList) {
        this.parcelaPagamentoList = parcelaPagamentoList;
    }

    public LancamentoPagar getIdLancamentoPagar() {
        return idLancamentoPagar;
    }

    public void setIdLancamentoPagar(LancamentoPagar idLancamentoPagar) {
        this.idLancamentoPagar = idLancamentoPagar;
    }

    public StatusParcela getIdStatusParcelaPagar() {
        return idStatusParcelaPagar;
    }

    public void setIdStatusParcelaPagar(StatusParcela idStatusParcelaPagar) {
        this.idStatusParcelaPagar = idStatusParcelaPagar;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ParcelaPagar)) {
            return false;
        }
        ParcelaPagar other = (ParcelaPagar) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.ParcelaPagar[ id=" + id + " ]";
    }
    
}
